package com.app.auth.service;

import com.app.auth.entity.vo.UserVO;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author sjw
 * @className CacheImpl
 * @date 2021/1/4 8:54
 * @description: TODO
 */

@Service
public class CacheImpl implements ICache {
    @Override
    @Cacheable(value = "userInfo",key = "T(String).valueOf(#user.id).concat('-').concat(#user.roleInfo!=null?#user.roleInfo.id:0)")
    public String test(UserVO user) {
        System.out.println(user.getName());
        return user.getName();
    }
}
